<template>
  <div>
    <el-menu :default-active="$route.path" @select="handleSelect">
      <el-submenu index="1">
        <template v-slot:title><i class="el-icon-message"></i>导航一</template>
        <el-menu-item-group>
          <el-menu-item index="/about">about页面</el-menu-item>
          <el-menu-item index="/one">路由跳转页面</el-menu-item>
          <el-menu-item index="/goodsTable">商品展示</el-menu-item>
          <el-menu-item index="1-3">选项3</el-menu-item>
        </el-menu-item-group>
      </el-submenu>
    </el-menu>
  </div>
</template>

<script>
  export default {
    methods: {
      handleSelect (key, keyPath) {
        console.log(key);
       this.$router.push(key)
      }
    }
  }
</script>
